int jump(int *nums, int numsSize) {
    int jumpNum = 0;
    int maxJump, maxJumpP;
    int i = 0;
    while (i < numsSize - 1) {
        maxJump = 0;
        maxJumpP = 0;
        for (int j = 1; j <= *(nums + i); ++j) {
            if (*(nums + i + j) + j >= maxJump) {
                maxJump = *(nums + i + j) + j;
                maxJumpP = j;
            }
            if (i + j >= numsSize - 1) {
                return jumpNum + 1;
            }
        }
        i += maxJumpP;
        jumpNum++;
    }
    return jumpNum;
}